<?php

namespace app\common\model\caijiatong;

use think\Model;

/**
 * 材价通 服务商城配置
 */
class ShoproConfig extends Model
{
    protected $connection = 'database.db_second';//连接配置
    protected $table = 'fa_shopro_config';//表名
    
    public static function getScoreConfig()
    {
        $config = self::where('name', 'score')->value('value');
        $config = $config ? json_decode($config, true) : [];
        return [
            'consume_get_score' => $config['consume_get_score'] ?? 0,//是否开启消费返积分
            'consume_get_score_ratio' => $config['consume_get_score_ratio'] ?? 0,//消费返积分比例
        ];
    }
}
